#include "CdiCamera.h"

BOOL CdiCamera::Running = FALSE;

CdiCamera::CdiCamera(void)
{
  if( true == Setup() )
  {
    SetCameraPosition( D3DXVECTOR3());
    SetCameraUp( D3DXVECTOR3(0,1,0));
    SetCameraLookAt( D3DXVECTOR3() );
  }
}

CdiCamera::~CdiCamera(void)
{
  CdiCamera::Running = FALSE;
}

CdiCamera::CdiCamera(D3DXVECTOR3& position, D3DXVECTOR3& lookAt, D3DXVECTOR3& up)
{
  if( true == Setup() )
  {
    SetCameraPosition( position );
    SetCameraUp( up );
    SetCameraLookAt( lookAt );
  }
}

void CdiCamera::SetCameraPosition(D3DXVECTOR3& position)
{
  m_position = position;
}

// Set the cameras up vector
void CdiCamera::SetCameraUp(D3DXVECTOR3& Up)
{
  m_up = Up;
}

// Set the camera's look at position
void CdiCamera::SetCameraLookAt(D3DXVECTOR3& LookAt)
{
  m_lookAt = LookAt;
}

// Get the current Camera Position
D3DXVECTOR3& CdiCamera::GetPosition(void)
{
  //TODO: insert return statement here
  return m_position;
}

// Get the Camera's up position
D3DXVECTOR3& CdiCamera::GetCameraUp(void)
{
  //TODO: insert return statement here
  return m_up;
}

// Get the camera's look at position
D3DXVECTOR3& CdiCamera::GetLookAt(void)
{
  //TODO: insert return statement here
  return m_lookAt;
}

// Sets the scale of the movement
void CdiCamera::SetScale(float scale)
{
  m_scale = scale;
}

bool CdiCamera::Setup()
{
  bool ok = true;
  if( CdiCamera::Running == TRUE )
  {
    ok = false;
    m_isEnabled = false;
  }
  else
  {
    CdiCamera::Running = TRUE;
  }
  return ok;
}
